Commit 4c6e4080 authored by beidson@apple.com's avatar beidson@apple.com

2009-04-13 Brady Eidson <beidson@apple.com>

        Reviewed by Tim Hatcher

        Tweak my last check-in, moving the thread violation check up to the API-level calls so the logging is more
        useful to developers/users.

        * WebView/WebFrame.mm:
        (-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): If not on the main thread, only
          perform the "call on main thead" workaround, as the log/exception raising is now up at the API level.
        (-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): Perform a thread violation check here so logging
          is more meaningful.
        (-[WebFrame loadHTMLString:baseURL:]): Ditto.
        (-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): Ditto.



git-svn-id: svn://svn.chromium.org/blink/trunk@42451 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent aca29a25
2009-04-13 Brady Eidson <beidson@apple.com>
Reviewed by Tim Hatcher
Tweak my last check-in, moving the thread violation check up to the API-level calls so the logging is more
useful to developers/users.
* WebView/WebFrame.mm:
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]): If not on the main thread, only
perform the "call on main thead" workaround, as the log/exception raising is now up at the API level.
(-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]): Perform a thread violation check here so logging
is more meaningful.
(-[WebFrame loadHTMLString:baseURL:]): Ditto.
(-[WebFrame loadAlternateHTMLString:baseURL:forUnreachableURL:]): Ditto.
2009-04-13 Brady Eidson <beidson@apple.com> 2009-04-13 Brady Eidson <beidson@apple.com>
Reviewed by Kevin Decker Reviewed by Kevin Decker
......
...@@ -1316,10 +1316,8 @@ static NSURL *createUniqueWebDataURL() ...@@ -1316,10 +1316,8 @@ static NSURL *createUniqueWebDataURL()
- (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL - (void)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL unreachableURL:(NSURL *)unreachableURL
{ {
if (!pthread_main_np()) { if (!pthread_main_np())
WebCoreThreadViolationCheckRoundTwo();
return [[self _webkit_invokeOnMainThread] _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:unreachableURL]; return [[self _webkit_invokeOnMainThread] _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:unreachableURL];
}
KURL responseURL; KURL responseURL;
if (!baseURL) { if (!baseURL) {
...@@ -1340,6 +1338,8 @@ static NSURL *createUniqueWebDataURL() ...@@ -1340,6 +1338,8 @@ static NSURL *createUniqueWebDataURL()
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL - (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
{ {
WebCoreThreadViolationCheckRoundTwo();
if (!MIMEType) if (!MIMEType)
MIMEType = @"text/html"; MIMEType = @"text/html";
[self _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:nil]; [self _loadData:data MIMEType:MIMEType textEncodingName:encodingName baseURL:baseURL unreachableURL:nil];
...@@ -1353,11 +1353,15 @@ static NSURL *createUniqueWebDataURL() ...@@ -1353,11 +1353,15 @@ static NSURL *createUniqueWebDataURL()
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
{ {
WebCoreThreadViolationCheckRoundTwo();
[self _loadHTMLString:string baseURL:baseURL unreachableURL:nil]; [self _loadHTMLString:string baseURL:baseURL unreachableURL:nil];
} }
- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL - (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL
{ {
WebCoreThreadViolationCheckRoundTwo();
[self _loadHTMLString:string baseURL:baseURL unreachableURL:unreachableURL]; [self _loadHTMLString:string baseURL:baseURL unreachableURL:unreachableURL];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment