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

Side by Side Diff: Source/core/loader/ImageLoader.cpp

Issue 353873003: Clean up usage of CSP functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix to apply Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | Source/core/page/EventSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 static inline bool pageIsBeingDismissed(Document* document) 58 static inline bool pageIsBeingDismissed(Document* document)
59 { 59 {
60 return document->pageDismissalEventBeingDispatched() != Document::NoDismissa l; 60 return document->pageDismissalEventBeingDispatched() != Document::NoDismissa l;
61 } 61 }
62 62
63 class ImageLoader::Task : public blink::WebThread::Task { 63 class ImageLoader::Task : public blink::WebThread::Task {
64 public: 64 public:
65 Task(ImageLoader* loader) 65 Task(ImageLoader* loader)
66 : m_loader(loader) 66 : m_loader(loader)
67 , m_shouldBypassMainWorldContentSecurityPolicy(false) 67 , m_shouldBypassMainWorldCSP(false)
68 , m_weakFactory(this) 68 , m_weakFactory(this)
69 { 69 {
70 LocalFrame* frame = loader->m_element->document().frame(); 70 LocalFrame* frame = loader->m_element->document().frame();
71 m_shouldBypassMainWorldContentSecurityPolicy = frame->script().shouldByp assMainWorldContentSecurityPolicy(); 71 m_shouldBypassMainWorldCSP = frame->script().shouldBypassMainWorldCSP();
72 } 72 }
73 73
74 virtual void run() OVERRIDE 74 virtual void run() OVERRIDE
75 { 75 {
76 if (m_loader) { 76 if (m_loader) {
77 m_loader->doUpdateFromElement(m_shouldBypassMainWorldContentSecurity Policy); 77 m_loader->doUpdateFromElement(m_shouldBypassMainWorldCSP);
78 } 78 }
79 } 79 }
80 80
81 void clearLoader() 81 void clearLoader()
82 { 82 {
83 m_loader = 0; 83 m_loader = 0;
84 } 84 }
85 85
86 WeakPtr<Task> createWeakPtr() 86 WeakPtr<Task> createWeakPtr()
87 { 87 {
88 return m_weakFactory.createWeakPtr(); 88 return m_weakFactory.createWeakPtr();
89 } 89 }
90 90
91 private: 91 private:
92 ImageLoader* m_loader; 92 ImageLoader* m_loader;
93 bool m_shouldBypassMainWorldContentSecurityPolicy; 93 bool m_shouldBypassMainWorldCSP;
94 WeakPtrFactory<Task> m_weakFactory; 94 WeakPtrFactory<Task> m_weakFactory;
95 }; 95 };
96 96
97 ImageLoader::ImageLoader(Element* element) 97 ImageLoader::ImageLoader(Element* element)
98 : m_element(element) 98 : m_element(element)
99 , m_image(0) 99 , m_image(0)
100 , m_derefElementTimer(this, &ImageLoader::timerFired) 100 , m_derefElementTimer(this, &ImageLoader::timerFired)
101 , m_hasPendingLoadEvent(false) 101 , m_hasPendingLoadEvent(false)
102 , m_hasPendingErrorEvent(false) 102 , m_hasPendingErrorEvent(false)
103 , m_imageComplete(true) 103 , m_imageComplete(true)
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 539 }
540 540
541 #if ENABLE(OILPAN) 541 #if ENABLE(OILPAN)
542 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 542 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
543 { 543 {
544 m_loader.willRemoveClient(m_client); 544 m_loader.willRemoveClient(m_client);
545 } 545 }
546 #endif 546 #endif
547 547
548 } 548 }
OLDNEW
« no previous file with comments | « Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | Source/core/page/EventSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698