Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 8760024: Cross-process postMessage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: New patch, still not quite done Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // In all other cases, we want to compare against the top frame's URL (as 772 // In all other cases, we want to compare against the top frame's URL (as
773 // opposed to the opener frame's), since that's what determines the type of 773 // opposed to the opener frame's), since that's what determines the type of
774 // process. This allows iframes outside an app to open a popup in the app. 774 // process. This allows iframes outside an app to open a popup in the app.
775 old_url = frame->top()->opener()->top()->document().url(); 775 old_url = frame->top()->opener()->top()->document().url();
776 } 776 }
777 777
778 // Determine if the old URL is an extension (excluding bookmark apps). 778 // Determine if the old URL is an extension (excluding bookmark apps).
779 const Extension* old_url_extension = GetNonBookmarkAppExtension(extensions, 779 const Extension* old_url_extension = GetNonBookmarkAppExtension(extensions,
780 old_url); 780 old_url);
781 781
782 // TODO(creis): Temporary workaround for crbug.com/59285: Only return true if 782 return old_url_extension != new_url_extension;
783 // we would enter an extension app's extent from a non-app, or if we leave an
784 // extension with no web extent. We avoid swapping processes to exit a hosted
785 // app for now, since we do not yet support postMessage calls from outside the
786 // app back into it (e.g., as in Facebook OAuth 2.0).
787 bool old_url_is_hosted_app = old_url_extension &&
788 !old_url_extension->web_extent().is_empty();
789 if (old_url_is_hosted_app)
790 return false;
791 783
792 return old_url_extension != new_url_extension;
793 } 784 }
794 785
795 void ChromeContentRendererClient::OnPurgeMemory() { 786 void ChromeContentRendererClient::OnPurgeMemory() {
796 DVLOG(1) << "Resetting spellcheck in renderer client"; 787 DVLOG(1) << "Resetting spellcheck in renderer client";
797 RenderThread* thread = RenderThread::Get(); 788 RenderThread* thread = RenderThread::Get();
798 if (spellcheck_.get()) 789 if (spellcheck_.get())
799 thread->RemoveObserver(spellcheck_.get()); 790 thread->RemoveObserver(spellcheck_.get());
800 SpellCheck* new_spellcheck = new SpellCheck(); 791 SpellCheck* new_spellcheck = new SpellCheck();
801 if (spellcheck_provider_) 792 if (spellcheck_provider_)
802 spellcheck_provider_->SetSpellCheck(new_spellcheck); 793 spellcheck_provider_->SetSpellCheck(new_spellcheck);
(...skipping 27 matching lines...) Expand all
830 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { 821 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
831 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); 822 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory);
832 } 823 }
833 824
834 bool ChromeContentRendererClient::AllowSocketAPI(const GURL& url) { 825 bool ChromeContentRendererClient::AllowSocketAPI(const GURL& url) {
835 return allowed_socket_origins_.find(url.host()) != 826 return allowed_socket_origins_.find(url.host()) !=
836 allowed_socket_origins_.end(); 827 allowed_socket_origins_.end();
837 } 828 }
838 829
839 } // namespace chrome 830 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698