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

Side by Side Diff: third_party/WebKit/Source/core/page/Page.cpp

Issue 2156803002: [HBD] Remove PluginCache and reload plugin list when origin changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per alexmos@'s comments Created 4 years, 4 months 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R ights Reserved.
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "core/page/FocusController.h" 47 #include "core/page/FocusController.h"
48 #include "core/page/PointerLockController.h" 48 #include "core/page/PointerLockController.h"
49 #include "core/page/ScopedPageLoadDeferrer.h" 49 #include "core/page/ScopedPageLoadDeferrer.h"
50 #include "core/page/ValidationMessageClient.h" 50 #include "core/page/ValidationMessageClient.h"
51 #include "core/page/scrolling/ScrollingCoordinator.h" 51 #include "core/page/scrolling/ScrollingCoordinator.h"
52 #include "core/paint/PaintLayer.h" 52 #include "core/paint/PaintLayer.h"
53 #include "platform/graphics/GraphicsLayer.h" 53 #include "platform/graphics/GraphicsLayer.h"
54 #include "platform/plugins/PluginData.h" 54 #include "platform/plugins/PluginData.h"
55 #include "platform/text/CompressibleString.h" 55 #include "platform/text/CompressibleString.h"
56 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
57 #include "public/platform/WebSecurityOrigin.h"
57 58
58 namespace blink { 59 namespace blink {
59 60
60 // Set of all live pages; includes internal Page objects that are 61 // Set of all live pages; includes internal Page objects that are
61 // not observable from scripts. 62 // not observable from scripts.
62 static Page::PageSet& allPages() 63 static Page::PageSet& allPages()
63 { 64 {
64 DEFINE_STATIC_LOCAL(Page::PageSet, allPages, ()); 65 DEFINE_STATIC_LOCAL(Page::PageSet, allPages, ());
65 return allPages; 66 return allPages;
66 } 67 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 237
237 PluginData::refresh(); 238 PluginData::refresh();
238 239
239 for (const Page* page : allPages()) { 240 for (const Page* page : allPages()) {
240 // Clear out the page's plugin data. 241 // Clear out the page's plugin data.
241 if (page->m_pluginData) 242 if (page->m_pluginData)
242 page->m_pluginData = nullptr; 243 page->m_pluginData = nullptr;
243 } 244 }
244 } 245 }
245 246
246 PluginData* Page::pluginData() const 247 PluginData* Page::pluginData()
247 { 248 {
248 if (!m_pluginData) 249 SecurityContext* context = mainFrame()->securityContext();
249 m_pluginData = PluginData::create(this); 250 // Frame::securityContext() may return null in tests. For that reason,
251 // whenever it's null, an unique SecurityOrigin is created instead.
dcheng 2016/08/03 14:34:58 Which tests? Can we fix the tests? Putting test-on
trizzofo 2016/08/03 19:11:18 There are quite a few of them. You can see it in P
tommycli 2016/08/03 20:53:39 I agree it would be ideal to fix the tests. dcheng
alexmos 2016/08/04 05:32:03 LocalFrame::securityContext() just returns the Loc
trizzofo 2016/08/05 02:04:26 Yes, you're right. I took a better look at DOMImpl
252 RefPtr<SecurityOrigin> mainFrameOrigin = context ? context->getSecurityOrigi n() : SecurityOrigin::createUnique().get();
253 WebSecurityOrigin webOrigin(mainFrameOrigin.get());
254
255 if (!m_pluginData || !mainFrameOrigin->isSameSchemeHostPort(m_mainFrameOrigi n.get()))
256 m_pluginData = PluginData::create(webOrigin);
257 m_mainFrameOrigin = mainFrameOrigin;
250 return m_pluginData.get(); 258 return m_pluginData.get();
251 } 259 }
252 260
253 void Page::setValidationMessageClient(ValidationMessageClient* client) 261 void Page::setValidationMessageClient(ValidationMessageClient* client)
254 { 262 {
255 m_validationMessageClient = client; 263 m_validationMessageClient = client;
256 } 264 }
257 265
258 void Page::setDefersLoading(bool defers) 266 void Page::setDefersLoading(bool defers)
259 { 267 {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 { 559 {
552 } 560 }
553 561
554 Page::PageClients::~PageClients() 562 Page::PageClients::~PageClients()
555 { 563 {
556 } 564 }
557 565
558 template class CORE_TEMPLATE_EXPORT Supplement<Page>; 566 template class CORE_TEMPLATE_EXPORT Supplement<Page>;
559 567
560 } // namespace blink 568 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698