Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "Chrome.h" | 10 #include "Chrome.h" |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 975 } | 975 } |
| 976 | 976 |
| 977 // Called whenever data is received. | 977 // Called whenever data is received. |
| 978 void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat a, int length) { | 978 void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat a, int length) { |
| 979 if (!plugin_widget_.get()) { | 979 if (!plugin_widget_.get()) { |
| 980 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); | 980 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); |
| 981 if (d) | 981 if (d) |
| 982 d->DidReceiveDocumentData(webframe_, data, length); | 982 d->DidReceiveDocumentData(webframe_, data, length); |
| 983 } | 983 } |
| 984 | 984 |
| 985 // If we are sending data to WebCore::MediaDocument, we should stop here | |
|
darin (slow to review)
2009/08/14 00:15:37
One more tweak I would make: move this code to th
Alpha Left Google
2009/08/14 00:32:13
Yes, it is the first bit of data that triggers the
darin (slow to review)
2009/08/14 07:30:44
OK, that makes sense. Thanks!
| |
| 986 // and cancel the request. | |
| 987 if (webframe_->frame()->document() && | |
| 988 webframe_->frame()->document()->isMediaDocument()) { | |
| 989 loader->cancelMainResourceLoad( | |
| 990 pluginWillHandleLoadError(loader->response())); | |
| 991 } | |
| 992 | |
| 985 // The plugin widget could have been created in the webframe_->DidReceiveData | 993 // The plugin widget could have been created in the webframe_->DidReceiveData |
| 986 // function. | 994 // function. |
| 987 if (plugin_widget_.get()) { | 995 if (plugin_widget_.get()) { |
| 988 if (!sent_initial_response_to_plugin_) { | 996 if (!sent_initial_response_to_plugin_) { |
| 989 sent_initial_response_to_plugin_ = true; | 997 sent_initial_response_to_plugin_ = true; |
| 990 plugin_widget_->didReceiveResponse( | 998 plugin_widget_->didReceiveResponse( |
| 991 webframe_->frame()->loader()->activeDocumentLoader()->response()); | 999 webframe_->frame()->loader()->activeDocumentLoader()->response()); |
| 992 } | 1000 } |
| 993 plugin_widget_->didReceiveData(data, length); | 1001 plugin_widget_->didReceiveData(data, length); |
| 994 } | 1002 } |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1428 | 1436 |
| 1429 std::string offset_str = url.ExtractFileName(); | 1437 std::string offset_str = url.ExtractFileName(); |
| 1430 int offset; | 1438 int offset; |
| 1431 if (!StringToInt(offset_str, &offset)) | 1439 if (!StringToInt(offset_str, &offset)) |
| 1432 return; | 1440 return; |
| 1433 | 1441 |
| 1434 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); | 1442 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); |
| 1435 if (d) | 1443 if (d) |
| 1436 d->NavigateBackForwardSoon(offset); | 1444 d->NavigateBackForwardSoon(offset); |
| 1437 } | 1445 } |
| OLD | NEW |