diff options
author | fgorski <fgorski@chromium.org> | 2015-06-02 17:28:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-03 00:29:39 +0000 |
commit | d0e3446c634964ac8ec0396df7ec1d25b3908740 (patch) | |
tree | fce382e63325a1237201f2db9fb7dc7e8835d687 /components/offline_pages/offline_page_item.cc | |
parent | 3346ab66acfd8bc8321edd794f238e8cfc0e7f9c (diff) | |
download | chromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.zip chromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.tar.gz chromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.tar.bz2 |
Initial commit of offline pages.
* Creates OfflinePageModel (not implemented) and basic OfflinePageItem
* Adds components/offline_pages with OWNERS and DEPS
* Creates components/offline_pages.gypi
* Includes offline pages across gyp files
BUG=491352
Review URL: https://codereview.chromium.org/1147983005
Cr-Commit-Position: refs/heads/master@{#332508}
Diffstat (limited to 'components/offline_pages/offline_page_item.cc')
-rw-r--r-- | components/offline_pages/offline_page_item.cc | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/components/offline_pages/offline_page_item.cc b/components/offline_pages/offline_page_item.cc new file mode 100644 index 0000000..637a9b2 --- /dev/null +++ b/components/offline_pages/offline_page_item.cc @@ -0,0 +1,52 @@ +// 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. + +#include "components/offline_pages/offline_page_item.h" + +#include "net/base/filename_util.h" + +namespace offline_pages { + +namespace { +const int kCurrentVersion = 1; +} + +OfflinePageItem::OfflinePageItem() + : version(kCurrentVersion), + file_size(0) { +} + +OfflinePageItem::OfflinePageItem(const GURL& url, + const std::string& title, + const base::FilePath& file_path, + int64 file_size) + : url(url), + title(title), + version(kCurrentVersion), + file_path(file_path), + file_size(file_size) { +} + +OfflinePageItem::OfflinePageItem(const GURL& url, + const std::string& title, + const base::FilePath& file_path, + int64 file_size, + const base::Time& creation_time) + : url(url), + title(title), + version(kCurrentVersion), + file_path(file_path), + file_size(file_size), + creation_time(creation_time), + last_access_time(creation_time) { +} + +OfflinePageItem::~OfflinePageItem() { +} + +GURL OfflinePageItem::GetOfflineURL() { + return net::FilePathToFileURL(file_path); +} + +} // namespace offline_pages |