| Index: android_webview/renderer/aw_render_frame_ext.cc
|
| diff --git a/android_webview/renderer/aw_render_frame_ext.cc b/android_webview/renderer/aw_render_frame_ext.cc
|
| index 69b06f05458d8f66dd32f89e7b9c987892e3d47e..61c8025b63d1e7b8518654b2ec7ffd8184670fd2 100644
|
| --- a/android_webview/renderer/aw_render_frame_ext.cc
|
| +++ b/android_webview/renderer/aw_render_frame_ext.cc
|
| @@ -17,6 +17,7 @@
|
| #include "third_party/WebKit/public/web/WebElementCollection.h"
|
| #include "third_party/WebKit/public/web/WebFrameWidget.h"
|
| #include "third_party/WebKit/public/web/WebHitTestResult.h"
|
| +#include "third_party/WebKit/public/web/WebImageCache.h"
|
| #include "third_party/WebKit/public/web/WebLocalFrame.h"
|
| #include "third_party/WebKit/public/web/WebMeaningfulLayout.h"
|
| #include "third_party/WebKit/public/web/WebNode.h"
|
| @@ -146,6 +147,21 @@ void AwRenderFrameExt::DidCommitProvisionalLoad(bool is_new_navigation,
|
| blink::WebSecurityOrigin origin = frame->document().getSecurityOrigin();
|
| origin.grantLoadLocalResources();
|
| }
|
| +
|
| + // Clear the cache when we cross site boundaries in the main frame.
|
| + //
|
| + // We're trying to approximate what happens with a multi-process Chromium,
|
| + // where navigation across origins would cause a new render process to spin
|
| + // up, and thus start with a clear cache. Wiring up a signal from browser to
|
| + // renderer code to say "this navigation would have switched processes" would
|
| + // be disruptive, so this clearing of the cache is the compromise.
|
| + if (!frame->parent()) {
|
| + url::Origin new_origin(frame->document().url());
|
| + if (!new_origin.IsSameOriginWith(last_origin_)) {
|
| + last_origin_ = new_origin;
|
| + blink::WebImageCache::clear();
|
| + }
|
| + }
|
| }
|
|
|
| bool AwRenderFrameExt::OnMessageReceived(const IPC::Message& message) {
|
|
|