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

Side by Side Diff: Source/core/html/imports/HTMLImportChild.cpp

Issue 183883004: Let ContentSecurityPolicy shared between imports and the master. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding guardRef()/guardDeref() Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 #include "core/html/imports/HTMLImportChild.h" 32 #include "core/html/imports/HTMLImportChild.h"
33 33
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/custom/CustomElement.h" 35 #include "core/dom/custom/CustomElement.h"
36 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" 36 #include "core/dom/custom/CustomElementMicrotaskImportStep.h"
37 #include "core/html/imports/HTMLImportChildClient.h" 37 #include "core/html/imports/HTMLImportChildClient.h"
38 #include "core/html/imports/HTMLImportLoader.h" 38 #include "core/html/imports/HTMLImportLoader.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 HTMLImportChild::HTMLImportChild(const KURL& url, bool createdByParser) 42 HTMLImportChild::HTMLImportChild(Document& master, const KURL& url, bool created ByParser)
43 : HTMLImport(createdByParser) 43 : HTMLImport(createdByParser)
44 , m_master(master)
44 , m_url(url) 45 , m_url(url)
45 , m_customElementMicrotaskStep(0) 46 , m_customElementMicrotaskStep(0)
46 , m_client(0) 47 , m_client(0)
47 { 48 {
49 m_master.guardRef();
48 } 50 }
49 51
50 HTMLImportChild::~HTMLImportChild() 52 HTMLImportChild::~HTMLImportChild()
51 { 53 {
52 // importDestroyed() should be called before the destruction. 54 // importDestroyed() should be called before the destruction.
53 ASSERT(!m_loader); 55 ASSERT(!m_loader);
54 56
55 if (m_customElementMicrotaskStep) { 57 if (m_customElementMicrotaskStep) {
56 // if Custom Elements were blocked, must unblock them before death 58 // if Custom Elements were blocked, must unblock them before death
57 m_customElementMicrotaskStep->importDidFinish(); 59 m_customElementMicrotaskStep->importDidFinish();
58 m_customElementMicrotaskStep = 0; 60 m_customElementMicrotaskStep = 0;
59 } 61 }
60 62
61 if (m_client) 63 if (m_client)
62 m_client->importChildWasDestroyed(this); 64 m_client->importChildWasDestroyed(this);
65
66 m_master.guardDeref();
63 } 67 }
64 68
65 void HTMLImportChild::wasAlreadyLoaded() 69 void HTMLImportChild::wasAlreadyLoaded()
66 { 70 {
67 ASSERT(!m_loader); 71 ASSERT(!m_loader);
68 ASSERT(m_client); 72 ASSERT(m_client);
69 stateWillChange(); 73 stateWillChange();
70 } 74 }
71 75
72 void HTMLImportChild::startLoading(const ResourcePtr<RawResource>& resource) 76 void HTMLImportChild::startLoading(const ResourcePtr<RawResource>& resource)
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 HTMLImport::showThis(); 242 HTMLImport::showThis();
239 fprintf(stderr, " loader=%p own=%s async=%s url=%s", 243 fprintf(stderr, " loader=%p own=%s async=%s url=%s",
240 m_loader.get(), 244 m_loader.get(),
241 hasLoader() && ownsLoader() ? "Y" : "N", 245 hasLoader() && ownsLoader() ? "Y" : "N",
242 isCreatedByParser() ? "Y" : "N", 246 isCreatedByParser() ? "Y" : "N",
243 url().string().utf8().data()); 247 url().string().utf8().data());
244 } 248 }
245 #endif 249 #endif
246 250
247 } // namespace WebCore 251 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/imports/HTMLImportChild.h ('k') | Source/core/html/imports/HTMLImportLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698