Add ICU message format support
[chromium-blink-merge.git] / content / renderer / internal_document_state_data.cc
blob939df3cce5ab94d7de0d62bd2c1ca8ef70d567ab
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/internal_document_state_data.h"
7 #include "content/public/renderer/document_state.h"
8 #include "third_party/WebKit/public/web/WebDataSource.h"
10 namespace content {
12 namespace {
14 // Key InternalDocumentStateData is stored under in DocumentState.
15 const char kUserDataKey[] = "InternalDocumentStateData";
19 InternalDocumentStateData::InternalDocumentStateData()
20 : did_first_visually_non_empty_layout_(false),
21 did_first_visually_non_empty_paint_(false),
22 http_status_code_(0),
23 is_overriding_user_agent_(false),
24 must_reset_scroll_and_scale_state_(false),
25 cache_policy_override_set_(false),
26 cache_policy_override_(blink::WebURLRequest::UseProtocolCachePolicy) {
29 // static
30 InternalDocumentStateData* InternalDocumentStateData::FromDataSource(
31 blink::WebDataSource* ds) {
32 return FromDocumentState(static_cast<DocumentState*>(ds->extraData()));
35 // static
36 InternalDocumentStateData* InternalDocumentStateData::FromDocumentState(
37 DocumentState* ds) {
38 if (!ds)
39 return NULL;
40 InternalDocumentStateData* data = static_cast<InternalDocumentStateData*>(
41 ds->GetUserData(&kUserDataKey));
42 if (!data) {
43 data = new InternalDocumentStateData;
44 ds->SetUserData(&kUserDataKey, data);
46 return data;
49 InternalDocumentStateData::~InternalDocumentStateData() {
52 } // namespace content