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

Unified Diff: Source/core/html/parser/PreloadRequest.h

Issue 1108303002: HTMLPreloadScanner unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nit Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/HTMLResourcePreloader.cpp ('k') | Source/core/html/parser/PreloadRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/PreloadRequest.h
diff --git a/Source/core/html/parser/HTMLResourcePreloader.h b/Source/core/html/parser/PreloadRequest.h
similarity index 54%
copy from Source/core/html/parser/HTMLResourcePreloader.h
copy to Source/core/html/parser/PreloadRequest.h
index 316decf81c47f5b1cc0360d034dce7528fc3ba3d..738635c272868f07587a97235677ba75c9689bf2 100644
--- a/Source/core/html/parser/HTMLResourcePreloader.h
+++ b/Source/core/html/parser/PreloadRequest.h
@@ -1,34 +1,12 @@
-/*
- * Copyright (C) 2013 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef HTMLResourcePreloader_h
-#define HTMLResourcePreloader_h
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PreloadRequest_h
+#define PreloadRequest_h
#include "core/fetch/FetchRequest.h"
#include "core/fetch/Resource.h"
-#include "wtf/CurrentTime.h"
#include "wtf/text/TextPosition.h"
namespace blink {
@@ -58,6 +36,10 @@ public:
Resource::Type resourceType() const { return m_resourceType; }
+ const String& resourceURL() const { return m_resourceURL; }
+ float resourceWidth() const { return m_resourceWidth.isSet ? m_resourceWidth.width : 0; }
+ const String& baseURL() const { return m_baseURL.string(); }
+
private:
PreloadRequest(const String& initiatorName, const TextPosition& initiatorPosition, const String& resourceURL, const KURL& baseURL, Resource::Type resourceType, const FetchRequest::ResourceWidth& resourceWidth)
: m_initiatorName(initiatorName)
@@ -90,22 +72,6 @@ private:
typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream;
-class HTMLResourcePreloader final : public NoBaseWillBeGarbageCollected<HTMLResourcePreloader> {
- WTF_MAKE_NONCOPYABLE(HTMLResourcePreloader); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLResourcePreloader);
-public:
- static PassOwnPtrWillBeRawPtr<HTMLResourcePreloader> create(Document&);
- DECLARE_TRACE();
-
- void takeAndPreload(PreloadRequestStream&);
-
-private:
- explicit HTMLResourcePreloader(Document&);
-
- void preload(PassOwnPtr<PreloadRequest>);
-
- RawPtrWillBeMember<Document> m_document;
-};
-
}
#endif
« no previous file with comments | « Source/core/html/parser/HTMLResourcePreloader.cpp ('k') | Source/core/html/parser/PreloadRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698